<div class="row">
    <div class="col-sm-7">
        <h1 class="pagetitle" data-i18n="common.roledetails">Role</h1>
    </div>
</div>

<pre ng-show="ErrorMessage!=null">{{ ErrorMessage }}</pre>
<form ng-submit="ctrl.submit()" class="form-horizontal" role="form" autocomplete="off">

    <div class="form-group">
        <label for="name" class="col-sm-2 control-label" data-i18n="common.name">Name</label>
        <div class="col-sm-4">
            <input ng-model="ctrl.model.name" class="form-control input-md" ng-disabled="ctrl.loading==true" />
        </div>
    </div>
    <div class="form-group" ng-repeat="m in ctrl.model.members">
        <label class="col-sm-2 control-label" data-i18n="common.member">member</label>
        {{ m.name }} {{ m._id }}
        <button ng-click="ctrl.RemoveMember(m)" type="button" ng-disabled="ctrl.loading==true" class="btn btn-success"
            data-i18n="common.remove">Remove</button>

    </div>
    <div class="form-group">
        <label for="add" class="col-sm-2 control-label" data-i18n="common.add">Add</label>
        <div class="col-sm-4">
            <select ng-model='ctrl.addthis'  ng-options='item._id as item.name for item in ctrl.users'></select>
            <button ng-click="ctrl.AddMember(ctrl.addthis)" type="button" ng-disabled="ctrl.loading==true" class="btn btn-success"
            data-i18n="common.add">Add</button>
        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" ng-disabled="ctrl.loading==true" class="btn btn-success"
                data-i18n="common.save">Save</button>
        </div>
    </div>


</form>